package com.zsix.system.strategy.jump;

import com.zsix.system.service.manager.ProcessTaskServiceManager;
import com.zsix.common.dto.SendActionDto;
import com.zsix.common.dto.controllerParams.ProcessTaskParams;
import org.activiti.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class JumpNone implements JumpStrategy {
    @Autowired //任务服务
    private TaskService taskService;
    @Autowired
    private ProcessTaskServiceManager processTaskServiceManager;
    @Override
    public SendActionDto Do(String username, ProcessTaskParams processTaskParams
            , String toUsers){
        SendActionDto sendActionDto=new SendActionDto();
        taskService.setAssignee(processTaskParams.getTaskId(),username);
        sendActionDto=processTaskServiceManager.sendWork(processTaskParams,username);
        sendActionDto.setTaskId(processTaskParams.getTaskId());
        sendActionDto.setProc_inst_id(processTaskParams.getProcessInstanceId());
        return sendActionDto;
    }
    /**
     * 返回服务类型
     * @return
     */
    @Override
    public String getType(){
        return "noUsers";
    }
}
